<template>
  <div>
    <blog-info :blog-id="blogId" />
    <comment :blog-id="blogId" />
  </div>
</template>

<script>
import blogInfo from './blog-info.vue'
import Comment from './comment.vue'
export default {
  components: { blogInfo, Comment },
  data() {
    return {
      // 当前博客 id
      blogId: null
    }
  },
  watch: {
    '$route.params.id': {
      immediate: true,
      handler: function(newVal) {
        this.blogId = newVal
      }
    }
  }
}
</script>

<style>

</style>
